FROM jrdaimao-registry-vpc.cn-beijing.cr.aliyuncs.com/system/centos7:latest
MAINTAINER JBM <jibaoman@idongwo.com>


ENV DUMPPATH /opt/logs/easyhome/dw-timed-task-center
RUN mkdir -p /home/easyhome/dw-timed-task-center/ && mkdir /home/easyhome/data/
# 拷贝jar，修改成自己项目的jar包，路径相对根目录
ARG JAR_LOCAL_PATH=dw-timed-task-center.jar
COPY ${JAR_LOCAL_PATH}  /home/easyhome/dw-timed-task-center/dw-timed-task-center.jar
COPY  jacocoagent.jar /home/easyhome/jacocoagent.jar
ADD dw-dbsecret /home/easyhome/data

# 将启动命令写入启动脚本 start.sh
RUN mkdir -p ${ADMIN_HOME}

RUN echo 'java -server -javaagent:/home/easyhome/jacocoagent.jar=includes=com.*,output=tcpserver,port=6301,address=0.0.0.0,append=true -Xmx4096m -Xms4096m -XX:NewRatio=2 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${DUMPPATH}/dw-timed-task-center.dump -Dspring.profiles.active=eh_uat -jar  ${CATALINA_OPTS} /home/easyhome/dw-timed-task-center/dw-timed-task-center.jar'> /home/easyhome/dw-timed-task-center/start.sh && chmod +x /home/easyhome/dw-timed-task-center/start.sh
WORKDIR ${ADMIN_HOME}
CMD ["/bin/bash", "/home/easyhome/dw-timed-task-center/start.sh"]
